package banking;

import money.Money;

public class GiroAccount extends Account {

	// ---------------------------------
	// Attributes
	// ---------------------------------

	// Im Moment noch statischer Zinssatz
	public int creditInterest = 2;
	public static int debitInterest = 0;

	// ---------------------------------
	// Constructors
	// ---------------------------------

	protected GiroAccount(int accountNumber, String accountHolder, String typ,
			String language, String country) {
		super(accountNumber, accountHolder, typ, language, country);
	}

	// ---------------------------------
	// Methods
	// ---------------------------------

	@Override
	public void interest() {
		// Abfrage ob Kontostand positiv oder negativ
		if (getBalance().getValue() < 0) {
			// Berechnung Soll Zinsen
			setBalance((long) (getBalance().getValue() * (1 - (double) debitInterest / 100)));
			System.out.println(showOutput());
		} else {
			// Berechnung Haben Zinsen
			setBalance((long) (getBalance().getValue() * (1 + (double) creditInterest / 100)));
			System.out.println(showOutput());
		}
	}

	@Override
	public void plus(Money addMoney) {
		setBalance(getBalance().getValue() + addMoney.getValue());
	}

	@Override
	public void minus(Money removeMoney) {
		setBalance(getBalance().getValue() - removeMoney.getValue());
	}

	@Override
	public void setInterestValue(int changeInterestValue) {
		debitInterest = changeInterestValue;

	}

	@Override
	public void setRuntimeValue(int length) {
		System.out.println("musch du änder");
	}

	@Override
	public void setTimestamp(long timestamp) {

	}

	@Override
	public long getTimestamp() {
		return 1;
	}

}